<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Users extends CI_Controller {
	/**
	 * show all users
	 * default page of users
	 * 
	 * @access	public
	 * @return	void
	 */
	function index() {
		$header["title"] = "Users";
		$header["style"] = css("style.css");
		
        $this->load->model("Users_model");
        $data["users"] = $this->Users_model->get_all();
		
		$this->load->view("header_view",$header);
		$this->load->view("users_view",$data);
		$this->load->view("footer_view");
	}
	
	/**
	 * show the specific user
	 * 
	 * @access	public
	 * @param	int
	 * @param	string
	 * @return	void
	 */
	function show_one($id=NULL,$fullname=NULL) {
		$header["title"] = $fullname;
		$header["style"] = css("style.css");
		
		if($id===NULL) {
			return FALSE;
		}
		
		$this->load->model("Users_model");
		
		echo $this->Users_model->global_where_conditions;
		
		echo $id."<br>".$fullname;
        $data["user"] = $this->Users_model->get($id);
	}
	
	/**
	 * show the signup form
	 * 
	 * @access	public
	 * @return	void
	 */
	function signup() {
		$header["title"] = "Sign Up";
		$header["style"] = css("style.css");
		$this->load->view("header_view",$header);
		
		if(!$this->input->post("signmeup")) {
            $this->load->helper("form");
			$this->load->view("signup_view");
		}
		else {
			echo "submit";
		}
		
		$this->load->view("footer_view");
	}
}

/* End of file users.php */
/* Location: ./application/controllers/users.php */